import { Provide } from '@midwayjs/core';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { NurseInfoEntity } from '../entity/info';

/**
 * 护士信息服务
 */
@Provide()
export class NurseInfoService extends BaseService {
  @InjectEntityModel(NurseInfoEntity)
  nurseInfoEntity: Repository<NurseInfoEntity>;

  async list(query){
    console.log(query,'已离职')
    let data = await this.nurseInfoEntity.createQueryBuilder()
    .where("status = :status OR id = :id", { status: query.status,id:query.nurseId })
    .getMany()
    return data
  }
}
